<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <title>小说列表</title>


    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">

    <!-- page specific plugin styles -->
    <script src="__PUBLIC__/admin/js/jquery.min.js"></script>
    <script src="__PUBLIC__/admin/js/lodash.min.js"></script>
    <script src="__PUBLIC__/admin/js/moment.min.js"></script>
    <script src="__PUBLIC__/admin/js/zh-cn.js"></script>
    <script src="__PUBLIC__/admin/js/numeral.min.js"></script>
    <script src="__PUBLIC__/admin/js/toastr.min.js"></script>
    <script src="__PUBLIC__/admin/js/cookies.js"></script>
    <script src="__PUBLIC__/admin/js/knockout-min.js"></script>
    <script src="__PUBLIC__/admin/js/knockout.mapping.min.js"></script>
    <!--<script src="__PUBLIC__/admin/js/bootstrap-datetimepicker.min.js"></script>-->
    <script src="__PUBLIC__/admin/js/jquery.validate.min.js"></script>
    <script src="__PUBLIC__/admin/js/jquery.validate.unobtrusive.min.js"></script>
    <script src="__PUBLIC__/admin/js/clipboard.min.js"></script>
    <script src="__PUBLIC__/admin/js/select2.min.js"></script>
    <script src="__PUBLIC__/admin/js/admin.js"></script>

    <script>
        moment.locale('zh-cn');
        toastr.options.positionClass = 'toast-bottom-right';
    </script>
    <script src="__PUBLIC__/admin/js/ace-extra.min.js"></script>

    <link media="all" href="__PUBLIC__/admin/css/index04.css" type="text/css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/glyphicons-halflings-regular.css">

    <!--<link href="__PUBLIC__/admin/dataTables/dataTables.bootstrap.css" rel="stylesheet" />-->
</head>
<body class="no-skin">

<!-- #section:basics/navbar.layout -->
<include file="./Public/gong/title.html"/>

<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <div id="sidebar" class="sidebar responsive">
        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'fixed')
            } catch (e) {
            }
        </script>

        <include file="./Public/gong/list.html"/>
        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left"
               data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>

        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'collapsed')
            } catch (e) {
            }
        </script>
    </div>

    <!-- /section:basics/sidebar -->
    <div class="main-content">

        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try {
                    ace.settings.check('breadcrumbs', 'fixed')
                } catch (e) {
                }
            </script>

            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="__APP__/Home/Index/index.html">Home</a>
                </li>
                <li class="active">小说列表</li>
            </ul><!-- /.breadcrumb -->

            <!-- /section:basics/content.searchbox -->
        </div>

        <!-- /section:basics/content.breadcrumbs -->
        <div class="page-content">
            <div class="page-content-area">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="actions-bar clearfix" style="margin-top: 15px;">
                            <ul class="nav nav-pills nav-pills-sm pull-left" style="margin-top: 3px;">
                                <li class="active"><a href="__URL__/book_list.html">全部</a></li>
                                <li class="active"><a href="__URL__/book_list?sex=1">男频</a></li>
                                <li class="active"><a href="__URL__/book_list?sex=2">女频</a></li>
                                <li class="active"><a href="__URL__/book_list?state=0">连载</a></li>
                                <li class="active"><a href="__URL__/book_list?state=1">完结</a></li>
                                <volist name="type" id="vt">
                                    <li class="active"><a href="__URL__/book_list?tid={$vt.id}">{$vt.name}</a></li>
                                </volist>
                            </ul>
                        </div>
                        <div style="text-align: right;">
                            <form action="{:U('book_list')}" method='get'>
                                <input name="keyword" value="{$keyword}"/>
                                <input name="closed" type="hidden" value="{$closed}"/>
                                <input type="submit" class="btn btn-primary" value="搜索">
                            </form>
                        </div>

                        <table class="table table-striped table-bordered responsive table-hover">
                            <thead>
                            <tr>
                                <td class="text-center">id</td>
                                <td class="text-center">封面</td>
                                <td class="text-center">名称</td>
                                <td class="text-center">
                                    <a href="{:U('book_list',['closed'=>1])}" data-nid="35" data-toggle="set-offline"
                                       title="" class="btn btn-success btn-xs">下架</a>
                                    <a href="{:U('book_list',['closed'=>0])}" data-nid="35" data-toggle="set-offline"
                                       title="" class="btn btn-success btn-xs">上架</a>
                                </td>
                                <td class="text-center">性别频度</td>
                                <td class="text-center">
                                    <a href="{:U('book_list',['free_time'=>0,'closed'=>$closed])}" data-nid="35" data-toggle="set-offline"
                                       title="" class="btn btn-success btn-xs">免费</a>
                                    <a href="{:U('book_list',['free_time'=>1,'closed'=>$closed])}" data-nid="35" data-toggle="set-offline"
                                       title="" class="btn btn-success btn-xs">收费</a>
                                </td>
                                <td class="text-center width-30">暗藏</td>
                                <td class="text-center">操作</td>

                            </tr>
                            </thead>
                            <tbody>
                            <volist name="books" id="vb">
                                <tr class="odd gradeX">
                                    <td class="text-center">
                                        {$vb.id}
                                    </td>
                                    <td class="text-center">
                                        <img src="{$vb.img}" width="50" height="65">
                                    </td>
                                    <td>
                                        <a href="__URL__/book_share?bid={$vb.id}">
                                            <!--[{$vb.name}]-->
                                            {$vb.title}</a>
                                        <!--  <span style="font-size: 13px;">[已完结]</span> -->
                                        <!--                <div class="text-muted" style="margin-top: 5px; line-height: 1.6em;">-->
                                        <!--                                                            共 {$vb.num} 章.-->
                                        <!--                                        第 10 章开始要求关注-->
                                        <!--                                    </div>-->
                                        <if condition="$vb['state'] eq 0"><span style="color:red;">连载中</span>
                                            <else/>
                                            已完结
                                        </if>
                                        <if condition="$vb['bid'] eq $vb['id']"><span style="color:red;">已迁移</span>
                                            <else/>
                                        </if>
                                    </td>
                                    <td class="text-center">
                                        <if condition="$vb['closed'] heq '1'">
                                            <a href="javascript:;" data-nid="35" data-toggle="set-offline" title=""
                                               class="btn btn-success btn-xs">
                                                已下架
                                            </a>
                                            <else/>
                                            <a href="javascript:;" data-nid="35" data-toggle="set-offline" title=""
                                               class="btn btn-success btn-xs">
                                                已上架
                                            </a>
                                            <button class="btn btn-primary btn-lg"
                                                    onclick="jpush({$vb.id},'{$vb.title}')" data-toggle="modal"
                                                    data-target="#myModal">推送
                                            </button>
                                            <button class="btn btn-primary btn-success"
                                                    onclick="buyBook({$vb.id},'{$vb.title}')" data-toggle="modal"
                                                    data-target="#myModal2">购买整本
                                            </button>
                                        </if>

                                    </td>
                                    <if condition="$vb['sex'] heq '1'">
                                        <td class="text-center">男频</td>
                                        <else/>
                                        <td class="text-center">女频</td>
                                    </if>
                                    <if condition="$vb['free_time'] heq '0'">
                                        <td class="text-center">免费</td>
                                        <else/>
                                        <td class="text-center">收费</td>
                                    </if>
                                    <if condition="$vb['hidden'] heq '0'">
                                        <td class="text-center">否</td>
                                        <else/>
                                        <td class="text-center">是</td>
                                    </if>
                                    <td class="text-center">
                                        <if condition="in_array($admin['level'],array(0,1)) ">
                                            <a href="__URL__/edit_book?id={$vb.id}" class="btn">编辑书籍</a>&nbsp;&nbsp;
                                            <if condition="$vb['show'] heq '1'">
                                                <a href="__URL__/book_doshow?id={$vb.id}" class="btn">推荐</a>&nbsp;&nbsp;
                                                <else/>
                                                <a href="__URL__/book_doshow?id={$vb.id}" class="btn"><font
                                                        style="color:#3f51b5;">取消推荐</font></a>&nbsp;&nbsp;
                                            </if>
                                            <if condition="$vb['hot'] heq '1'">
                                                <a href="__URL__/book_dohot?id={$vb.id}" class="btn">热门</a>&nbsp;&nbsp;
                                                <else/>
                                                <a href="__URL__/book_dohot?id={$vb.id}" class="btn"><font
                                                        style="color:#3f51b5;">取消热门</font></a>&nbsp;&nbsp;
                                            </if>
                                            <if condition="$vb['eic'] heq '1'">
                                                <a href="__URL__/book_doeic?id={$vb.id}" class="btn">今日推荐</a>&nbsp;&nbsp;
                                                <else/>
                                                <a href="__URL__/book_doeic?id={$vb.id}" class="btn"><font
                                                        style="color:#3f51b5;">取消今日推荐</font></a>&nbsp;&nbsp;
                                            </if>
                                            <if condition="$vb['is_top'] heq '1'">
                                                <a href="__URL__/is_top_book?id={$vb.id}&is_top=0" class="btn"><font
                                                        style="color:#3f51b5;">取消置顶</font></a>&nbsp;&nbsp;
                                                <else/>
                                                <a href="__URL__/is_top_book?id={$vb.id}&is_top=1" class="btn"><font
                                                        style="color:#3f51b5;">置顶</font></a>&nbsp;&nbsp;
                                            </if>
                                            <if condition="$vb['closed'] heq '1'">
                                                <a href="__URL__/closed_book?id={$vb.id}&closed=0" class="btn">开启</a>&nbsp;&nbsp;
                                                <else/>
                                                <a href="__URL__/closed_book?id={$vb.id}&closed=1" class="btn"><font
                                                        style="color:#3f51b5;">关闭</font></a>&nbsp;&nbsp;
                                            </if>
                                            <!--<a href="__URL__/del_book?id={$vb.id}" class="btn">删除</a>&nbsp;&nbsp;-->
                                        </if>
                                    </td>
                                </tr>
                            </volist>


                            </tbody>
                        </table>


                        <div class="pager">
                            {$page}
                        </div>

                        <div class="modal fade" style="margin-top: 50px;" id="myModal" tabindex="-1" role="dialog"
                             aria-labelledby="myModalLabel" aria-hidden="true">
                            <form action="{:U('Jpush/jpush')}" method="post">
                                <div class="modal-dialog">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                                &times;
                                            </button>
                                            <h4 class="modal-title" id="myModalLabel">
                                                APP消息推送
                                            </h4>
                                        </div>
                                        <input type='hidden' id="bookid" name="bid">
                                        <input type='hidden' id="type" name="book" value="book">
                                        <input type='hidden' id="typeid" name="type_id" value="1">
                                        <div class="modal-body">
                                            <div class="input-group">
                                                <span class="input-group-addon">标题</span>
                                                <input class="form-control" id="title" type="text" name="title"/>
                                            </div>

                                            <div class="input-group">
                                                <span class="input-group-addon">内容</span>
                                                <textarea rows="3" cols="65"
                                                          style="margin: 0px; width: 514px; height: 89px;" type="text"
                                                          name="content"/></textarea>
                                            </div>
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                                            </button>
                                            <button type="submit" class="btn btn-primary">立即推送</button>
                                        </div>
                                    </div><!-- /.modal-content -->
                                </div><!-- /.modal -->
                            </form>
                        </div>
                        <div class="modal fade" style="margin-top: 100px;height: 500px;" id="myModal2" tabindex="-1" role="dialog"
                             aria-labelledby="myModalLabel" aria-hidden="true">
                            <form action="{:U('Book/buyBook')}" method="post">
                                <div class="modal-dialog">
                                    <div class="modal-content" style="padding: 20px;">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                                &times;
                                            </button>
                                            <div class="modal-title" id="myModalLabel">购买一本书</div>
                                        </div>
                                        <input type='hidden' id="bookid2" name="bid">
                                        <div class="modal-body">
                                            <div class="input-group">
                                                <span class="input-group-addon">书名</span>
                                                <input class="form-control" type='text' id="title2" name="book_name">
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">用户id</span>
                                                <input  class="form-control" type='text' name="user_id">
                                            </div>
                                        </div>

                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                                            </button>
                                            <button type="submit" class="btn btn-primary">确认</button>
                                        </div>
                                    </div><!-- /.modal-content -->
                                </div><!-- /.modal -->
                            </form>
                        </div>

                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content-area -->
        </div><!-- /.page-content -->
    </div><!-- /.main-content -->

</div><!-- /.main-container -->
<!--<script src="__PUBLIC__/admin/js/bootstrap.min.js"></script>-->
<script src="__PUBLIC__/admin/js/jquery.webui-popover.min.js"></script>
<script src="__PUBLIC__/admin/js/jquery.ui.widget.min.js"></script>
<script src="__PUBLIC__/admin/js/jquery.fileupload.min.js"></script>
<script src="__PUBLIC__/admin/js/ace-elements.min.js"></script>
<script src="__PUBLIC__/admin/js/ace.min.js"></script>

<script src="elements.onpage-help.js"></script>
<script src="ace.onpage-help.js"></script>

<script src="__PUBLIC__/admin/dataTables/jquery.dataTables.js"></script>
<!--<script src="__PUBLIC__/admin/dataTables/dataTables.bootstrap.js"></script>-->
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!--            <script>
                $(document).ready(function () {
                    $('#dataTables-example').dataTable();
                });
        </script>-->
<script>
    function jpush(id, title) {
        console.log(title);
        $('#bookid').val(id);
        $('#title').val(title);
    }
    function buyBook(id, title) {
        console.log(title);
        $('#bookid2').val(id);
        $('#title2').val(title);
    }
</script>
</body>
</html>
